<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\FormVal;

/* @var $this yii\web\View */
/* @var $model backend\modules\supplier\models\Factory */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="factory-form">

    <?php $form = ActiveForm::begin(); ?>
    
    <div>
        <legend>基本信息</legend>
        <div class="row">
            <div class="col-sm-4"><?= $form->field($model, 'name')->textInput(['maxlength' => 50]) ?></div>
            <div class="col-sm-4"><?= $form->field($model, 'contacts')->textInput(['maxlength' => 20]) ?></div>
        </div>
    </div>
    
    
    <div>
        <legend>通讯方式</legend>
        <div class="row">
            <div class="col-sm-2"><?= $form->field($model, 'mobile')->textInput(['maxlength' => 12]) ?></div>
            <div class="col-sm-2"><?= $form->field($model, 'tel')->textInput(['maxlength' => 12]) ?></div>
            <div class="col-sm-2"><?= $form->field($model, 'qq')->textInput(['maxlength' => 20]) ?></div>
        </div>
    </div>
    
    <?= $form->field($model, 'address')->textInput(['maxlength' => 100]) ?>
    
    <div>
        <legend>其它信息</legend>
        <div class="row">
            <div class="col-sm-4"><?= $form->field($model, 'remark')->textInput(['maxlength' => 100]) ?></div>
            <div class="col-sm-4"><?= $form->field($model, 'website')->textInput(['maxlength' => 30]) ?></div>
            <div class="col-sm-4"><?= $form->field($model, 'email')->textInput(['maxlength' => 30]) ?></div>
        </div>
    </div>
    
    <?= $form->field($model, 'enable')->radioList(FormVal::$bool, ['separator' => FormVal::$separator10]); ?>
    
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '新建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
